import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Products from '../views/Products.vue'
import Sreach from '../views/Sreach.vue'
import Shopcart from '../views/Shopcart.vue'
import Details from '../views/Details.vue'
import Reglog from '../components/Reglog.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    component: Index
  },
  {
    path: '/reglog',
    name: 'Reglog',
    component: Reglog
  },
  {
    path: '/products',
    name: 'Products',
    component: Products
  },
  {
    path: '/sreach/:sreac',
    name: 'Sreach',
    component: Sreach
  },
  {
    path: '/shopcart',
    name: 'Shopcart',
    component: Shopcart
  },
  {
    path: '/details/:pid',
    name: 'Details',
    component: Details
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
